package com.yunshang.shoppingmall.service.impl;

import com.yunshang.shoppingmall.entity.Product;
import com.yunshang.shoppingmall.mapper.ProductMapper;
import com.yunshang.shoppingmall.mapper.ProductPriceMapper;
import com.yunshang.shoppingmall.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("productService")
public class ProductServiceImpl implements ProductService {

    @Autowired
    ProductMapper productMapper;

    @Override
    public int deleteByPrimaryKey(Integer productId) {
        return productMapper.deleteByPrimaryKey(productId);
    }

    /**
     * 增加商品
     * @param product 商品
     * @return
     */
    @Override
    public int insert(Product product) {

        return productMapper.insert(product);
    }

    @Override
    public int insertSelective(Product product) {
        return productMapper.insertSelective(product);
    }

    @Override
    public Product selectByPrimaryKey(Integer productId) {
        return productMapper.selectByPrimaryKey(productId);
    }

    @Override
    public int updateByPrimaryKeySelective(Product product) {
        return productMapper.updateByPrimaryKeySelective(product);
    }

    @Override
    public int updateByPrimaryKey(Product product) {
        return productMapper.updateByPrimaryKey(product);
    }

    @Override
    public List<Product> selectSupplier() {
        return productMapper.selectSupplier();
    }

    @Override
    public List<Product> selectProductByName(String productName) {
        return null;
    }

    @Override
    public List<Product> selectProductByActiveSign(int activeSign) {
        List< Product> productList=productMapper.selectProductByActiveSign(activeSign);
        return productList ;
    }

    @Override
    public List<Product> selectProductByRJClassId(int rjClassId) {
        return productMapper.selectProductByRJClassId(rjClassId);
    }

    @Override
    public List<Product> selectProductsList() {
        return productMapper.selectProductsList();
    }

    @Override
    public List<Product> selectProductHsys() {
        return productMapper.selectProductHsys();
    }


}
